<!DOCTYPE html>
<html>
<head>
	<title>版本详情</title>
	<!--#include("../common/common-link.html"){}-->
	<style type="text/css">
		.layui-form-switch{margin-top: 0;}
		.table-panel .content table{margin: 0 auto;margin-top: 10px;}
		.table-panel .content table tr{height: 49px;}
		.table-panel .content table tr.btns td .btn{width: 123px;outline: none;margin-top:20px;}
		.table-panel .content table tr td .need{color: red;}
		.table-panel .content table tr td.left{text-align: right;}
		.table-panel .content table tr td.right{text-align: left;width:330px;}
		.table-panel .content table tr td.center{text-align: center;}
	</style>
</head>
<body>
	<div id="container-wrap" style="display:none;">
		<div class="table-panel">
			<div class="header">
				<h4 class="title">版本详情</h4>
				<div class="btns-group">
					<input type="button" class="btn btn-primary" onclick="javascript:window.history.back()" value="返回"/>
				</div>
			</div>
			<div class="content">
				<table>
					<tr>
						<td class="left">外部版本：</td>
						<td class="right">
							<span>{{version}}</span>
						</td>
					</tr>
					<tr>
						<td class="left">内部版本：</td>
						<td class="right">
							<span>{{edition}}</span>
						</td>
					</tr>
					<tr>
						<td class="left">系统：</td>
						<td class="right">
							<span>{{osTypeMap[osType]}}</span>
						</td>
					</tr>
					<tr>
						<td class="left">终端：</td>
						<td class="right">
						    <span>{{terminalTypeMap[terminalType]}}</span>
						</td>
					</tr>
					<tr>
						<td class="left">强制升级：</td>
						<td class="right">
							<div class="layui-form" v-if="forceUpgrade">
								<div id="switch" class="layui-unselect layui-form-switch layui-form-onswitch" lay-skin="_switch"><em>是</em><i></i></div>
							</div>
							<div class="layui-form" v-else>
								<div id="switch" class="layui-unselect layui-form-switch" lay-skin="_switch"><em>否</em><i></i></div>
							</div>
						</td>
					</tr>
					<tr>
						<td class="left" style="vertical-align: top">包链接：</td>
						<td class="right" style="vertical-align: top">
							<span>{{linkHref}}</span>
						</td>
					</tr>
					<tr>
						<td class="left" style="vertical-align: top">更新内容：</td>
						<td class="right" style="vertical-align: top">
					    	<span>{{content}}</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	var data = {};
	var form={};
	function initVue() {
		initOsType();
		initTerminalType();
		initForceUpgrade();
		new Vue({
			el:"#container-wrap",
			data:data
		});
		Vue.nextTick(function() {
			$("#container-wrap").show();
		});
	};
	function request(callback){
		load_id=util.load();
		util.post({
			url:"/version/detail",
			data:form,
			success : function(result) {
				$.extend(data, result);
			},
			complete : function() {
				layer.close(load_id);
			}
		},callback);
	};
	function initOsType(){
		var map={};
		map["1"]="Android";
		data.osTypeMap=map;
	};
	function initTerminalType(){
		var map={};
		map["1"]="商户总店";
		map["4"]="商户分店";
		data.terminalTypeMap=map;
	};
	function initForceUpgrade(){
		var map={};
		map["0"]="否";
		map["1"]="是";
		data.forceUpgradeMap=map;
	};
	function cancel(){
		window.history.back();
	};
	function initialize(){
		form.id=util.getParameter("id");
		request(initVue);
	}
</script>
</html>